<?php

class Log_Adapter_File extends Log_Adapter
{
	protected $_path = null;

	public function __construct($name, $config = null)
	{
		$this -> _path = APP_TEMPORARY_PATH . '/log/log-' . date('Y-m-d') . '.log';
	}

	public function write($message, $level = null)
	{
		if (null == $level)
		{
			$level = Logger::INFO;
		}
		if ($fp = fopen($this -> _path, 'a+'))
		{
			fwrite($fp, $this -> format($message, $level));
			fclose($fp);
		}
	}

}
